﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Skyhook.Core;

namespace Skyhook.Isometry
{
    internal class WorldObjectController : IObjectController
    {
        WorldPosition pPosition = null;
        WorldObjectControllerDeleteEvent OnDelete = null;

        public WorldObjectController(WorldPosition position, WorldObjectControllerDeleteEvent ondelete)
        {
            pPosition = position;
            OnDelete = ondelete;
        }

        public void Put(float x, float y)
        {
            pPosition.Put(x, y);
        }

        public void Move(float dx, float dy)
        {
            pPosition.Move(dx, dy);
        }

        public void Delete()
        {
            if (OnDelete != null)
            {
                OnDelete();
            }
        }

        public virtual float X
        {
            get
            {
                return pPosition.X;
            }
        }

        public virtual float Y
        {
            get
            {
                return pPosition.Y;
            }
        }

        public virtual Vector2 Position
        {
            get
            {
                return pPosition.Position;
            }
        }
    }
}
